-> using the new #macro keyword, enjoy.. this was hard work!
-> (LS)
-> 1.9 : FIX : some (very few) functions could return crap.
/* Exec support functions */
#macro BeginIO(ioreq:PTR TO io) (VOID) IS Stores(io) BUT ASM ' bsr _BeginIO' BUT ASM ' addq.l #4, a7'
#macro CreateExtIO(port:PTR TO mp, iosize:LONG) (PTR TO io) IS Stores(port, iosize) BUT ASM ' bsr _CreateExtIO' BUT ASM ' addq.l #8, a7'
#macro CreatePort(name:PTR TO CHAR, pri:LONG) (PTR TO mp) IS Stores(name,pri) BUT ASM ' bsr _CreatePort' BUT ASM ' addq.l #8, a7'
#macro CreateStdIO(port:PTR TO mp) (PTR TO iostdreq) IS Stores(port) BUT ASM ' bsr _CreateStdIO' BUT ASM ' addq.l #4, a7'
#macro CreateTask(name:PTR TO CHAR, pri:LONG, initpc:PTR TO ANY, stacksize:LONG) (PTR TO task) IS Stores(name,pri,initpc,stacksize) BUT ASM ' bsr _CreateTask' BUT ASM ' lea 16(a7), a7'
#macro DeleteExtIO(ioreq:PTR TO iorequest) (VOID) IS Stores(ioreq) BUT ASM ' bsr _DeleteExtIO' BUT ASM ' addq.l #4, a7'
#macro DeletePort(ioreq:PTR TO mp) (VOID) IS Stores(ioreq) BUT ASM ' bsr _DeletePort' BUT ASM ' addq.l #4, a7'
#macro DeleteStdIO(ioreq:PTR TO iostreq) (VOID) IS Stores(ioreq) BUT ASM ' bsr _DeleteStdIO' BUT ASM ' addq.l #4, a7'
#macro DeleteTask(task:PTR TO task) (VOID) IS Stores(task) BUT ASM ' bsr _DeleteTask' BUT ASM ' addq.l #4, a7'
#macro NewList(list:PTR TO mlh) (VOID) IS Stores(list) BUT ASM ' bsr _NewList' BUT ASM ' addq.l #4, a7'
-> yaec-note : theese are in exec.library anyway..
->#macro LibAllocPooled(poolheader:PTR TO ANY, memsize:LONG) (PTR TO ANY) IS Stores(poolheader,memsize) BUT ASM ' bsr _LibAllocPooled' BUT ASM ' addq.l #8, a7'
->#macro LibCreatePool(memflags:LONG, puddlesize:LONG, treshsize:LONG) (PTR TO ANY) IS Stores(memflags,puddlesize,treshsize) BUT ASM ' bsr _LibCreatePool' BUT ASM ' lea 12(a7), a7'
->#macro LibDeletePool(poolheader:PTR TO ANY) (VOID) IS Stores(poolheader) BUT ASM ' bsr _LibDeletePool' BUT ASM ' addq.l #4, a7'
->#macro LibFreePooled(poolheader:PTR TO ANY, memory:PTR TO ANY, memsize:LONG) (PTR TO ANY) IS Stores(poolheader,memory,memsize) BUT ASM ' bsr _LibDeletePool' BUT ASM ' lea 12(a7), a7'
/* Assorted functions in amiga.lib */
#macro FastRand(seed:LONG) (LONG) IS Stores(seed) BUT ASM ' bsr _FastRand' BUT ASM ' addq.l #4, a7'
#macro RangeRand(maxvalue:LONG) (LONG) IS Stores(maxvalue) BUT ASM ' bsr _RangeRand' BUT ASM ' addq.l #4, a7'
-> yaec-note : global RangeSeed can not be reached,
-> use this function instead. Returns oldseed.
#macro SetRangeSeed(newseed:LONG) (LONG) IS (D1 := newseed) BUT ASM ' move.l _RangeSeed(a4), d0' BUT ASM ' move.l d1, RangeSeed(a4)'
/* Graphics support functions in amiga.lib */
#macro AddTOF(i_:PTR TO isrvstr, p_:PTR TO ANY, a_:LONG) (VOID) IS Stores(i_,p_,a_) BUT ASM ' bsr _AddTOF' BUT ASM ' lea 12(a7), a7'
#macro RemTOF(i_:PTR TO isrvstr) (VOID) IS Stores(i_) BUT ASM ' bsr _RemTOF' BUT ASM ' addq.l #4, a7'
#macro waitbeam(b_:LONG) (VOID) IS Stores(b_) BUT ASM ' bsr _waitbeam' BUT ASM ' addq.l #4, a7'
/* math support functions in amiga.lib */
-> yaec : uses motorola fast floating point, E uses IEEE. Reming them out..
->#macro afp(string:PTR TO CHAR) (FLOAT) IS Stores(string) BUT ASM ' bsr _afp' BUT ASM ' addq.l #4, a7'
->#macro arnd(place:LONG, exp:LONG, string:PTR TO CHAR) (VOID) IS Stores(place,exp,string) BUT ASM ' bsr _arnd' BUT ASM ' lea 12(a7), a7'
->#macro dbf(exp:LONG, mant:LONG) (FLOAT) IS Stores(exp,mant) BUT ASM ' bsr _dbf' BUT ASM ' addq.l #8, a7'
->#macro fpa(fnum:FLOAT, string:PTR TO CHAR) (LONG) IS Stores(fnum,string) BUT ASM ' bsr _fpa' BUT ASM ' addq.l #8, a7'
->#macro fpbcd(fnum:FLOAT, string:PTR TO CHAR) (VOID) IS Stores(fnum,string) BUT ASM ' bsr _fpbcd' BUT ASM ' addq.l #8, a7'
/* Timer support functions in amiga.lib (V36 and higher only) */
#macro TimeDelay(unit:LONG, secs:LONG, mseconds:LONG) (LONG) IS Stores(unit,secs,mseconds) BUT ASM ' bsr _TimeDelay' BUT ASM ' lea 12(a7), a7'
#macro DoTimer(tv:PTR TO timeval, unit:LONG, command:LONG) (LONG) IS Stores(tv,unit,command) BUT ASM ' bsr _DoTimer' BUT ASM ' lea 12(a7), a7'
/* Commodities functions in amiga.lib (V36 and higher only) */
-> yaec : not sure how theese will work with yaec..
->#macro ArgArrayDone() (VOID) IS ASM ' bsr _ArgArrayDone'
->#macro ArgArrayInit(argc:LONG, argv:PTR TO ANY) (PTR TO ANY) IS Stores(argc,argv) BUT ASM ' bsr _ArgArrayInit' BUT ASM ' addq.l #8, a7'
->#macro ArgInt(tt:PTR TO ANY, entry:PTR TO CHAR, defaultval:LONG) (LONG) IS Stores(tt,entry,defaultval) BUT ASM ' bsr _ArgInt' BUT ASM ' lea 12(a7), a7'
->#macro ArgString(tt:PTR TO ANY, entry:PTR TO CHAR, defaulstring:PTR TO CHAR) (PTR TO CHAR) IS Stores(tt,entry,defaultval) BUT ASM ' bsr _ArgString' BUT ASM ' lea 12(a7), a7'
#macro HotKey(description:PTR TO CHAR, port:PTR TO mp, id:LONG) (PTR TO cxobj) IS Stores(description,port,id) BUT ASM ' bsr _HotKey' BUT ASM ' lea 12(a7), a7'
#macro InvertString(str_:PTR TO CHAR, km:PTR TO keymap) (PTR TO inputevent) IS Stores(str_,km) BUT ASM ' bsr _InvertString' BUT ASM ' addq.l #8, a7'
#macro FreeIEvents(events:PTR TO inputevent) (VOID) IS Stores(events) BUT ASM ' bsr _FreeIEvents' BUT ASM ' addq.l #4, a7'
/* Commodities #macros */
-> yaec: theese already exists in libraries/commodities.e..reming..
->#macro CxFilter(d:PTR TO CHAR) (PTR TO cxobj) IS CreateCxObj(CX_FILTER, d, 0)
->#macro CxSender(port:PTR TO mp, id:LONG) (PTR TO cxobj) IS CreateCxObj(CX_SEND, port, id)
->#macro CxSignal(task:PTR TO task, sig:LONG) (PTR TO cxobj) IS CreateCxObj(CX_SIGNAL, task, sig)
->#macro CxTranslate(ie:PTR TO inputevent) (PTR TO cxobj) IS CreateCxObj(CX_TRANSLATE, ie, 0)
->#macro CxDebug(id:LONG) (PTR TO cxobj) IS CreateCxObj(CX_DEBUG, id, 0)
->#macro CxCustom(action:PTR TO ANY, id:LONG) (PTR TO cxobj) IS CreateCxObj(CX_CUSTOM, action, id)
/* ARexx support functions in amiga.lib */
#macro CheckRexxMsg(rexxmsg:PTR TO mn) (LONG) IS Stores(rexxmsg) BUT ASM ' bsr _CheckRexxMsg' BUT ASM ' addq.l #4, a7'
#macro GetRexxVar(rexxmsg:PTR TO mn, name:PTR TO CHAR, result:PTR TO ANY) (LONG) IS Stores(rexxmsg,name,result) BUT ASM ' bsr _GetRexxVar' BUT ASM ' lea 12(a7), a7'
#macro SetRexxVar(rexxmsg:PTR TO mn, name:PTR TO CHAR, value:PTR TO CHAR, length:LONG) (LONG) IS Stores(rexxmsg,name,value,length) BUT ASM ' bsr _SetRexxVar' BUT ASM ' lea 16(a7), a7'
/* Intuition hook and boopsi support functions in amiga.lib. */
/* These functions do not require any particular ROM revision */
/* to operate correctly, though they deal with concepts first introduced */
/* in V36. These functions would work with compatibly-implemented */
/* hooks or objects under V34. */
#macro CallHookA(hookptr:PTR TO hook, obj:PTR TO object, message:ANY) (ANY) IS Stores(hookptr,obj,msg) BUT ASM ' bsr _CallHookA' BUT ASM ' lea 12(a7), a7'
#macro CallHook(hookptr:PTR TO hook, obj:PTR TO object,...) (ANY) IS Stores(hookptr,obj,...) BUT ASM ' bsr _CallHook' BUT Rems(VARARGS+2*4) BUT D0
#macro DoMethodA(obj:PTR TO object, message:PTR TO msg) (ANY) IS Stores(obj,msg) BUT ASM ' bsr _DoMethodA' BUT ASM ' addq.l #8, a7'
#macro DoMethod(obj:PTR TO object, methodid:LONG,...) (ANY) IS Stores(obj,methodid,...) BUT ASM ' bsr _DoMethod' BUT Rems(VARARGS+2*4) BUT D0
#macro DoSuperMethodA(cl:PTR TO iclass, obj:PTR TO object, message:PTR TO msg) (ANY) IS Stores(cl,obj,message) BUT ASM ' bsr _DoSuperMethodA' BUT ASM ' lea 12(a7), a7'
#macro DoSuperMethod(cl:PTR TO iclass, obj:PTR TO object, methodid:LONG,...) (ANY) IS Stores(cl,obj,methodid,...) BUT ASM ' bsr _DoSuperMethod' BUT Rems(VARARGS+3*4) BUT D0
#macro CoerceMethodA(cl:PTR TO iclass, obj:PTR TO object, message:PTR TO msg) (ANY) IS Stores(cl,obj,message) BUT ASM ' bsr _CoerceMethodA' BUT ASM ' lea 12(a7), a7'
#macro CoerceMethod(cl:PTR TO iclass, obj:PTR TO object, methodid:LONG,...) (ANY) IS Stores(cl,obj,methodid,...) BUT ASM ' bsr _CoerceMethod' BUT Rems(VARARGS+3*4) BUT D0
#macro SetSuperAttrs(cl:PTR TO iclass, obj:PTR TO object, tag1:ANY,...) (ANY) IS Stores(cl,obj,tag1,...) BUT ASM ' bsr _SetSuperAttrs' BUT Rems(VARARGS+3*4) BUT D0
/* Network-support functions in amiga.lib. */
/* ACrypt() first appeared in later V39 versions of amiga.lib, but */
/* operates correctly under V37 and up. */
#macro ACrypt(buffer:PTR TO CHAR, password:PTR TO CHAR, username:PTR TO CHAR) (PTR TO CHAR) IS Stores(buffer,password,username) BUT ASM ' bsr _ACrypt' BUT ASM ' lea 12(a7), a7'